package com.xinzhi.savingpot.util;

import java.util.Random;

/**
 * 生成随机六位数
 */

public class CodeUtil {
    /**
     * 随机四位数字验证码
     *
     * @return 四位数验证码
     */


    /**测试生成随机数
    public static void main(String[] args) {
        authCode();
    }*/
    public static String authCode() {

        Random random = new Random();

        String[] arr = {"1", "2", "3", "4", "5", "6", "7", "8", "9", "0"};
        String authCode = "";
        for (int i = 0; i < 6; i++) {
            authCode += arr[random.nextInt(arr.length)];

        }
        System.out.println(authCode);
        return authCode;
    }

}
